package com.zero.manage.web.components.entity;

import io.gitee.zerowsh.enums.ToolEnums;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * 模板中使用数据
 */
@Getter
@Setter
public class TableEntity {
    //表的名称
    private String tableName;
    //表的备注
    private String comments;
    //表的列名
    private List<ColumnEntity> columns;

    //类名(第一个字母大写)，如：sys_user => SysUser
    private String className;
    //类名(第一个字母小写)，如：sys_user => sysUser
    private String classname;

    private boolean existTimestamp;

    private boolean existDate;

    private boolean existBigDecimal;
    //基类
    private ToolEnums.BaseEntityEnums baseEntity;
    //生成包路径
    private String packagePath;
    //作者
    private String author;

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getClassname() {
        return classname;
    }

    public void setClassname(String classname) {
        this.classname = classname;
    }

    /**
     * 模板中使用的字段信息
     */
    @Getter
    @Setter
    @Builder
    public static class ColumnEntity {
        //列名
        private String columnName;
        //列名类型
        private String dataType;
        //列名备注
        private String comments;
        //属性类型
        private String attrType;
        //是否主键
        private Boolean isPrimaryKey;
        //是否自动递增
        private Boolean isAutoincrement;
        //属性名称
        private String attrName;
    }
}